CURDIR := $(shell pwd)
LIBDIR := $(CURDIR)/../linux

LIB += -L$(LIBDIR)/lib
INC += -I$(LIBDIR)/include
INC += -I$(CURDIR)/state_online
INC += -I$(CURDIR)/state_startup

MAIN += main.c
THREAD += thread.c
THREAD += ../source/efsmt.c

SRCS += state_online/online.c
SRCS += state_online/online_function.c
SRCS += state_offline/offline.c
SRCS += state_startup/startup.c
SRCS += state_startup/startup_function.c

all:
	export LD_LIBRARY_PATH=$(LIBDIR)/lib
	gcc $(MAIN) $(SRCS) -o main -I../source -pthread -Wall
	gcc $(THREAD) $(SRCS) -o thread -I../source -pthread -Wall

clean:
	rm main thread

